plot_AMCEs_sims <- function(input_ranks=NULL, path=NULL){
  # we now use construct_vote_abstain to construct the matrix indicating full
  # schedule of choices voters of each type will make in every possible matchup
  vote_mat <- construct_vote_abstain(input_ranks)
  # create a list of type weights based on abstention scenarios
  voter_weights <- weight_types(abstention_ratios=list(c(0.5, 0.5, 0.5, 0.5),
                                                       # Scenario 2: voters preferring pro-life candidates always vote, but voters 
                                                       # preferring tax increases start abstaining if there are no candidates willing 
                                                       # to increase taxes
                                                       c(0.60, 0.40, 0.60, 0.40),
                                                       # Scenario 3: voters preferring tax increases candidates always vote, but
                                                       # voters preferring pro-life start abstaining if there are no pro-life candidates
                                                       c(0.40, 0.60, 0.40, 0.60)))
  
  inputAMCEs <- calculate_AMCEs_sims(voter_weights, vote_mat)
  #browser()
  #if(is.null(inputAMCEs)){
  #  stop("Must input some AMCEs for us to plot!")
  #}
  if(is.null(path)){
    stop("Must input path where you want to save your figure!")
  }
 # browser()
  # this code makes Figure A.1
  pdf(file = path, family = "Times", height = 13, width = 10)
  layout(matrix(c(1,2,3,4,5,6,7,8,9,10,11,12,13,13,13), nrow=5, byrow=TRUE), 
         widths = c(0.30, 0.35, 0.35), heights = c(0.10, 0.27, 0.27, 0.27, 0.15))
  par(mar=c(0,0,0,0))
  plot(0,0, type="n", axes=FALSE, xlab="", ylab="")
  text(x=0.03, y=0, "Which Voters\nCan Abstain?", cex=3)
  par(mar=c(0,0,0,0))
  plot(0,0, type="n", axes=FALSE, xlab="", ylab="")
  text(x=0.2, y=0, "Pro-Life AMCE", cex=2.5)
  plot(0,0, type="n", axes=FALSE, xlab="", ylab="")
  text(x=0.175, y=0, "Cutting Taxes AMCE", cex=2.5)
  plot(0,0, type="n", axes=FALSE, xlab="", ylab="")
  text(x=0.03, y=0, "Both Types\n(Equal Proportions)", cex=2.25)
  par(mar=c(8,6,2,1))
  plot(y = inputAMCEs[1:11, 1], x = 1:11, ylim = c(range(inputAMCEs)[1]-.05, range(inputAMCEs)[2]+.05),
       xaxt='n', type = "o", pch = 2,
       ylab = "AMCE", xlab = "Proportion Abstaining",
       col = "grey70", cex.lab=2, cex.axis=2, cex=1.5
  )
  axis(side = 1, at = c(1:11), labels = c("0%", "10%", "20%", "30%", "40%", "50%", "60%", "70%", "80%", "90%", "100%"), cex.axis=2)
  lines(y = inputAMCEs[12:22, 1], x = 1:11, col = "black", type = "o", pch = 18, lty = 2, lwd=1.5, cex=1.5)
  lines(y = inputAMCEs[23:33, 1], x = 1:11, col = "grey40", type = "o", pch = 19, lty=3, lwd=1.5, cex=1.5)
  par(mar=c(8,6,2,1))
  plot(y = inputAMCEs[1:11, 2], x = 1:11, ylim = c(range(inputAMCEs)[1]-.05, range(inputAMCEs)[2]+.05),
       xaxt='n', type = "o", pch = 2,
       ylab = "AMCE", xlab = "Proportion Abstaining",
       col = "grey70", cex.lab=2, cex.axis=2, cex=1.5
  )
  axis(side = 1, at = c(1:11), labels = c("0%", "10%", "20%", "30%", "40%", "50%", "60%", "70%", "80%", "90%", "100%"), cex.axis=2)
  lines(y = inputAMCEs[12:22, 2], x = 1:11, col = "black", type = "o",  pch = 18, lty = 2, lwd=1.5, cex=1.5)
  lines(y = inputAMCEs[23:33, 2], x = 1:11, col = "grey40", type = "o", pch = 19, lty=3, lwd=1.5, cex=1.5)
  plot(0,0, type="n", axes=FALSE, xlab="", ylab="")
  text(x=0.03, y=0, "Type 1 Voters Only", cex=2.25)
  par(mar=c(8,6,2,1))
  plot(y = inputAMCEs[34:44, 1], x = 1:11, ylim = c(range(inputAMCEs)[1]-.05, range(inputAMCEs)[2]+.05),
       xaxt='n', type = "o", pch = 2,
       ylab = "AMCE", xlab = "Proportion Abstaining",
       col = "grey70", cex.lab=2, cex.axis=2, cex=1.5
  )
  axis(side = 1, at = c(1:11), labels = c("0%", "10%", "20%", "30%", "40%", "50%", "60%", "70%", "80%", "90%", "100%"), cex.axis=2)
  lines(y = inputAMCEs[45:55, 1], x = 1:11, col = "black", type = "o",  pch = 18, lty = 2, lwd=1.5, cex=1.5)
  lines(y = inputAMCEs[56:66, 1], x = 1:11, col = "grey40", type = "o", pch = 19, lty=3, lwd=1.5, cex=1.5)
  par(mar=c(8,6,2,1))
  plot(y = inputAMCEs[34:44, 2], x = 1:11, ylim = c(range(inputAMCEs)[1]-.05, range(inputAMCEs)[2]+.05),
       xaxt='n', type = "o", pch = 2,
       ylab = "AMCE", xlab = "Proportion Abstaining",
       col = "grey70", cex.lab=2, cex.axis=2, cex=1.5
  )
  axis(side = 1, at = c(1:11), labels = c("0%", "10%", "20%", "30%", "40%", "50%", "60%", "70%", "80%", "90%", "100%"), cex.axis=2)
  lines(y = inputAMCEs[45:55, 2], x = 1:11, col = "black", type = "o",  pch = 18, lty = 2, lwd=1.5, cex=1.5)
  lines(y = inputAMCEs[56:66, 2], x = 1:11, col = "grey40", type = "o", pch = 19, lty=3, lwd=1.5, cex=1.5)
  plot(0,0, type="n", axes=FALSE, xlab="", ylab="")
  text(x=0.03, y=0, "Type 2 Voters Only", cex=2.25)
  par(mar=c(8,6,2,1))
  plot(y = inputAMCEs[67:77, 1], x = 1:11, ylim = c(range(inputAMCEs)[1]-.05, range(inputAMCEs)[2]+.05),
       xaxt='n', type = "o", pch = 2,
       ylab = "AMCE", xlab = "Proportion Abstaining",
       col = "grey70", cex.lab=2, cex.axis=2, cex=1.5
  )
  axis(side = 1, at = c(1:11), labels = c("0%", "10%", "20%", "30%", "40%", "50%", "60%", "70%", "80%", "90%", "100%"), cex.axis=2)
  lines(y = inputAMCEs[78:88, 1], x = 1:11, col = "black", type = "o",  pch = 18, lty = 2, lwd=1.5, cex=1.5)
  lines(y = inputAMCEs[89:99, 1], x = 1:11, col = "grey40", type = "o", pch = 19, lty=3, lwd=1.5, cex=1.5)
  par(mar=c(8,6,2,1))
  plot(y = inputAMCEs[67:77, 2], x = 1:11, ylim = c(range(inputAMCEs)[1]-.05, range(inputAMCEs)[2]+.05),
       xaxt='n', type = "o", pch = 2,
       ylab = "AMCE", xlab = "Proportion Abstaining",
       col = "grey70", cex.lab=2, cex.axis=2, cex=1.5
  )
  axis(side = 1, at = c(1:11), labels = c("0%", "10%", "20%", "30%", "40%", "50%", "60%", "70%", "80%", "90%", "100%"), cex.axis=2)
  lines(y = inputAMCEs[78:88, 2], x = 1:11, col = "black", type = "o",  pch = 18, lty = 2, lwd=1.5, cex=1.5)
  lines(y = inputAMCEs[89:99, 2], x = 1:11, col = "grey40", type = "o", pch = 19, lty=3, lwd=1.5, cex=1.5)
  
  par(mar=c(0,0,0,0))
  plot(0,0, type="n", axes=FALSE, xlab="", ylab="")
  legend(x = 0, y = 1, legend=c("50% Type 1, 50% Type 2",
                                "60% Type 1, 40% Type 2",
                                "40% Type 1, 60% Type 2"),
         lty=c(1,2,3), pch=c(2,18,19), col=c("grey70", "black", "grey40"), ncol = 1,
         title="Proportions of Voter Types", cex=2)
  
  dev.off()
}
